all: helloworld helloworld2 helloworld_static helloworld_dynamic

helloworld : helloworld.cc
	g++ -o helloworld helloworld.cc

helloworld2 : students.cc helloworld2.cc
	g++ -o helloworld2 students.cc helloworld2.cc

helloworld_static : helloworld2.cc students.o
	g++ -o helloworld_static students.o helloworld2.cc

students.o : students.h students.cc
	g++ -fpic -c students.cc

helloworld_dynamic : helloworld2.cc libstudents.so
	g++ -o helloworld_dynamic helloworld2.cc libstudents.so

libstudents.so : students.o
	gcc -shared -o libstudents.so students.o

clean:
	rm -f helloworld helloworld2 helloworld_static helloworld_dynamic *.o *.so

